import type { FixedLengthArray } from "@utils";

export const convertToCoordinatePairs = (
  coordinates: number[]
): FixedLengthArray<number, 2>[] => {
  const pairs: FixedLengthArray<number, 2>[] = [];
  for (let i = 0; i < coordinates.length; i += 2) {
    pairs.push([coordinates[i], coordinates[i + 1]]);
  }
  return pairs;
};